using System;
using System.Collections.Generic;
using System.Text;

namespace uk.co.tonyditchfield.tort.attributes
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public sealed class PrimeKeyAttribute : DBFieldAttribute
    {
        public PrimeKeyAttribute()
            : base()
        {
            Generator = attributeproperties.PrimeKeyGenerator.Database;
        }

        public PrimeKeyAttribute(string columnName)
            : base(columnName)
        {
            Generator = attributeproperties.PrimeKeyGenerator.Database;
        }

        public PrimeKeyAttribute(attributeproperties.PrimeKeyGenerator generator, String columnName)
            : base(columnName)
        {
            Generator = generator;
        }

        private attributeproperties.PrimeKeyGenerator generator;

        public attributeproperties.PrimeKeyGenerator Generator
        {
            get { return generator; }
            set { generator = value; }
        }
    }
}
